package mydate;

import java.util.Calendar;

/**
 * 第二代日期类  jdk1.1引入
 * @author Raymond
 * @create 2025/4/23 14:58
 */
public class MyCalendar {
    public static void main(String[] args) {
        Calendar instance = Calendar.getInstance();
        System.out.println("instance.get(Calendar.YEAR) = " + instance.get(Calendar.YEAR));
        //注意月份是从0开始的
        System.out.println("instance.get(Calendar.MONTH) = " + (instance.get(Calendar.MONTH)+1));
        System.out.println("instance.get(Calendar.DAY_OF_MONTH) = " + instance.get(Calendar.DAY_OF_MONTH));
        System.out.println("instance.get(Calendar.HOUR) = " + instance.get(Calendar.HOUR));
        System.out.println("instance.get(Calendar.MINUTE) = " + instance.get(Calendar.MINUTE));
        System.out.println("instance.get(Calendar.SECOND) = " + instance.get(Calendar.SECOND));
    }
}
